<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="oneroom.admin.oneroom.roomModel" %>
<jsp:useBean id="dao" scope="page" class="oneroom.admin.oneroom.roomDao" />
<jsp:useBean id="codeDao" scope="page" class="oneroom.admin.code.codeDao" />
<%

	//기본 세트 값 시작
	String searchGubn = request.getParameter("searchGubn") == null ? "" : request.getParameter("searchGubn");
	String searchValue = request.getParameter("searchValue") == null ? "" : request.getParameter("searchValue");
	int     giSelectPage  	= Integer.parseInt(request.getParameter("txtSelectPage") == null ? "0" :request.getParameter("txtSelectPage"));			//현재 선택된 페이지 저장
	int     giSelectBlock 	= Integer.parseInt(request.getParameter("txtSelectBlock") == null ? "0" :request.getParameter("txtSelectBlock"));			//현재 선택된 블락페이지 저장
	//기본 세트 값 끝

	String oneroom_seq = request.getParameter("oneroom_seq") == null ? "" : request.getParameter("oneroom_seq");
	roomModel model = dao.getView(oneroom_seq);
	
	//List subwayList = codeDao.getDtlList("001");// 지하철
	//List heatingList = codeDao.getDtlList("300");// 난방 시설
	//List airconditioningList = codeDao.getDtlList("301");// 냉방 시설
	//List  university1List = codeDao.getDtlList("400");// 대학교 지역
	//List  roomnumberList = codeDao.getDtlList("500");// 매물 종류
	//List  furnitureList = codeDao.getDtlList("302");// 가구
	//List  appliancesList = codeDao.getDtlList("303");//가전
	//List  kitchenList = codeDao.getDtlList("304"); //주방
	//List  securityList = codeDao.getDtlList("305"); //보안
	//List  facilityList = codeDao.getDtlList("306"); //주변시설
	//코드 값을 코드 명으로 변경
	model.setRoomkind(codeDao.getDtlName("500",model.getRoomkind()));
	String subWay = model.getSubway1();
	model.setSubway1(codeDao.getDtlName("001",model.getSubway1()));
	model.setSubway2(codeDao.getDtlName(subWay,model.getSubway2()));
	model.setHeating(codeDao.getDtlName("300",model.getHeating()));
	model.setAirconditioning(codeDao.getDtlName("301",model.getAirconditioning()));
	int university = Integer.parseInt(model.getUniversity1() == null ? "0" :model.getUniversity1()) ;
	university = 400 + university;
	model.setUniversity1(codeDao.getDtlName("400",model.getUniversity1()));
	model.setUniversity2(codeDao.getDtlName(university+"",model.getUniversity2()));
	
	String[] furniture = model.getFurniture1().split(",");
	String furnitureName = "";
	for(int i = 0; i<furniture.length; i++){
		furnitureName = furnitureName+codeDao.getDtlName("302",furniture[i])+" ";
	}
	model.setFurniture1(furnitureName);
	
	String[] appliances = model.getAppliances1().split(",");
	String appliancesName = "";
	for(int i = 0; i<appliances.length; i++){
		appliancesName = appliancesName+codeDao.getDtlName("303",appliances[i])+" ";
	}
	model.setAppliances1(appliancesName);
	
	String[] kitchen = model.getKitchen1().split(",");
	String kitchenName = "";
	for(int i = 0; i<kitchen.length; i++){
		kitchenName = kitchenName+codeDao.getDtlName("304",kitchen[i])+" ";
	}
	model.setKitchen1(kitchenName);
	
	String[] security = model.getSecurity1().split(",");
	String securityName = "";
	for(int i = 0; i<security.length; i++){
		securityName = securityName+codeDao.getDtlName("305",security[i])+" ";
	}
	model.setSecurity1(securityName);
	
	String[] facility = model.getFacility1().split(",");
	String facilityName = "";
	for(int i = 0; i<facility.length; i++){
		facilityName = facilityName+codeDao.getDtlName("306",facility[i])+" ";
	}
	model.setFacility1(facilityName);
	

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>원룸 - 매물 정보</title>
<script type="text/javascript" src="/admin/js/default.js"></script>
<link href="/admin/css/default.css" rel="stylesheet" type="text/css" />
<!--[if lte IE 6]><link rel="stylesheet" href="/admin/css/forie6.css" type="text/css" /><![endif]-->
<script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
<!--
$(document).ready(function(){
	
	$('#btList').click(function() {
		document.getElementById("frm").action = "list.jsp";
		document.getElementById("frm").submit();
	});
	$('#btDelete').click(function() {
		document.getElementById("gubun").value = "D";
		document.getElementById("frm").action = "roomdbx.jsp";
		document.getElementById("frm").submit();
	});
	
});
//-->
</script>
</head>
<body>
<div id="bodywrap">
	<div class="all-wrap">
		<%@ include file="/admin/common/top.jsp" %>
		<div id="right-wrap">
			<%@ include file="/admin/common/navi.jsp" %>
			<!--Contents Start-->
			<div id="content">
				<form action="update.jsp" name="frm" id="frm" method="post">
				<input type="hidden" name="searchGubn" id="searchGubn"  value="<%=searchGubn %>"/>
				<input type="hidden" name="searchValue" id="searchValue"  value="<%=searchValue %>"/>
				<input type="hidden" name="txtSelectPage" id="txtSelectPage"  value="<%=giSelectPage %>"/>
				<input type="hidden" name="txtSelectBlock" id="txtSelectBlock" value="<%=giSelectBlock %>"/> 
				<input type="hidden" name="oneroom_seq" id="oneroom_seq" value="<%=oneroom_seq %>"/>
				<input type="hidden" name="gubun" id="gubun" value=""/>
				<!-- 삭제 관련된 변수 시작 -->
				<input type="hidden" name="photo1_path" 	value="<%=model.getPhoto1()%>"/>
				<input type="hidden" name="photo1_small" 	value="<%=model.getPhoto1_small()%>"/>
				<input type="hidden" name="photo1_big" 		value="<%=model.getPhoto1_big()%>"/>
				<input type="hidden" name="photo2_path" 	value="<%=model.getPhoto2()%>"/>
				<input type="hidden" name="photo2_small" 	value="<%=model.getPhoto2_small()%>"/>
				<input type="hidden" name="photo2_big" 		value="<%=model.getPhoto2_big()%>"/>
				<input type="hidden" name="photo3_path" 	value="<%=model.getPhoto3()%>"/>
				<input type="hidden" name="photo3_small" 	value="<%=model.getPhoto3_small()%>"/>
				<input type="hidden" name="photo3_big" 		value="<%=model.getPhoto3_big()%>"/>
				<input type="hidden" name="photo4_path" 	value="<%=model.getPhoto4()%>"/>
				<input type="hidden" name="photo4_small" 	value="<%=model.getPhoto4_small()%>"/>
				<input type="hidden" name="photo4_big"		value="<%=model.getPhoto4_big()%>"/>
				<input type="hidden" name="photo5_path" 	value="<%=model.getPhoto5()%>"/>
				<input type="hidden" name="photo5_small" 	value="<%=model.getPhoto5_small()%>"/>
				<input type="hidden" name="photo5_big" 		value="<%=model.getPhoto5_big()%>"/>
				<input type="hidden" name="photo6_path" 	value="<%=model.getPhoto6()%>"/>
				<input type="hidden" name="photo6_small" 	value="<%=model.getPhoto6_small()%>"/>
				<input type="hidden" name="photo6_big" 		value="<%=model.getPhoto6_big()%>"/>
				<!-- 삭제 관련되 변수 끝 -->
				<!-- 타이틀 및 전체 갯수 검색 시작 -->
				<div class="path">
					<span>home</span> &gt;  매물 정보
				</div>
				<h4>매물 정보</h4>
				<p class="sub-text">매물 정보 확인/관리 하실 수 있습니다.</p>
				<!-- 타이틀 및 전체 갯수 검색  끝-->
				<!-- 실제적인 리스트 시작 -->
				<p class="sub-text2">기본 정보</p>
					<table class="view-normal" cellpadding="0" cellspacing="0" summary="매물 정보" >
					<caption>매물 정보</caption>
					    <col width="100px" />  
					    <col width="239px" />  
					    <col width="100px" />  
					    <col width="239px" />  
				    <tbody>
						<tr>
							<th scope="row" >주소</th>
							<td>
								<%=model.getAddress1() %>
								<%=model.getAddress2() %>
								<%=model.getAddress3() %>
								<%=model.getAddress4() %>
								<%=model.getAddress5() %>
							</td>
							<th scope="row" >번지</th>
							<td>
								<%=model.getZipcode1() %> 
								~ <%=model.getZipcode2() %>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >방수</th>
							<td>
								<%=model.getRoomnumber() %> 개
							</td>
							<th scope="row" >매물종류 </th>
							<td>
							<%=model.getRoomkind() %>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >평수</th>
							<td>
								<%=model.getRoomarea() %>
								 평
							</td>
							<th scope="row" >전세 </th>
							<td>
								<%=model.getRoommoney() %> 만원
							</td>
				        </tr>
				        <tr>
							<th scope="row" >층</th>
							<td>
								<%=model.getRoomfloor1() %> / <%=model.getRoomfloor2() %>
							</td>
							<th scope="row" >월세 </th>
							<td>
								보증금 :<%=model.getRoommonth1() %> 만원  / 월 :<%=model.getRoommonth2() %> 만원
							</td>
				        </tr>
				        <tr>
							<th scope="row" >주차</th>
							<td>
								<%=model.getCar() %>
								 대
							</td>
							<th scope="row" >관리비 </th>
							<td>
								<%=model.getManagemoney() %> 만원
							</td>
				        </tr>
					</tbody>
					</table>
					<br></br>
					<p class="sub-text2"> 주변 환경 및 옵션 정보</p>
					<table class="view-normal" cellpadding="0" cellspacing="0" summary="매물 정보" >
					<caption>매물 정보</caption>
					    <col width="100px" />  
					    <col width="239px" />  
					    <col width="100px" />  
					    <col width="239px" />  
				    <tbody>
				     <tr>
							<th scope="row" >지하철</th>
							<td colspan="3">
								<%=model.getSubway1() %> <%=model.getSubway2() %> <%=model.getSubway3() %>
								
				        </tr>
				        <tr>
							<th scope="row" >난방시설</th>
							<td>
								<%=model.getHeating() %>
							</td>
							<th scope="row" >냉방시설 </th>
							<td>
								<%=model.getAirconditioning() %>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >대학교</th>
							<td colspan="3">
								<%=model.getUniversity1() %>
								<%=model.getUniversity2() %>
								<%=model.getUniversity3() %>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >임대형태</th>
							<td colspan="3">
								<%=model.getLease() %>
								<%=model.getLeaseyear() %>
								<%=model.getLeasemonth() %>
								<%=model.getLeaseday() %>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >가구</th>
							<td colspan="3">
								<%=model.getFurniture1() %>
								<%=model.getFurniture2() %>
								<%=model.getFurniture3() %>
								<%=model.getFurniture4() %>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >가전</th>
							<td colspan="3">
								<%=model.getAppliances1() %>
								<%=model.getAppliances2() %>
								<%=model.getAppliances3() %>
								<%=model.getAppliances4() %>
								<%=model.getAppliances5() %>
								<%=model.getAppliances6() %>
								<%=model.getAppliances7() %>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >주방/욕실</th>
							<td colspan="3">
								<%=model.getKitchen1() %>
								<%=model.getKitchen2() %>
								<%=model.getKitchen3() %>
								<%=model.getKitchen4() %>
								<%=model.getKitchen5() %>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >보안</th>
							<td colspan="3">
								<%=model.getSecurity1() %>
								<%=model.getSecurity2() %>
								<%=model.getSecurity3() %>
								<%=model.getSecurity4() %>
								<%=model.getSecurity5() %>
								<%=model.getSecurity6() %>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >주변시설</th>
							<td colspan="3">
								<%=model.getFacility1() %>
								<%=model.getFacility2() %>
								<%=model.getFacility3() %>
								<%=model.getFacility4() %>
								<%=model.getFacility5() %>
							</td>
				        </tr>
				    </tbody>
					</table>
					<br></br>
					<p class="sub-text2"> 홍보사항 </p>
					<table class="view-normal" cellpadding="0" cellspacing="0" summary="홍보사항" >
					<caption>홍보사항</caption>
					    <col width="100px" />  
					    <col width="239px" />  
					    <col width="100px" />  
					    <col width="239px" />  
				    <tbody>
				     	<tr>
							<th scope="row" >제목</th>
							<td colspan="3">
							<%=model.getTitle() %>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >내용</th>
							<td colspan="3">
							<%=model.getContent().replaceAll("\n","</br>") %>
							</td>
				        </tr>
				        <tr>
							<th scope="row" >담당자</th>
							<td>
							<%=model.getPerson() %>
							</td>
							<th scope="row" >연락처</th>
							<td>
							<%=model.getTel1() %> - <%=model.getTel2() %> - <%=model.getTel3() %>
							</td>
				        </tr>
				    </tbody>
					</table>
					<br></br>
					<p class="sub-text2"> 사진등록 </p>
					<table class="view-normal" cellpadding="0" cellspacing="0" summary="홍보사항" >
					<caption>홍보사항</caption> 
					    <col width="339px" />   
					    <col width="339px" />  
				    <tbody>
				     	<tr>
							<td>
							<img src="/download/<%=model.getPhoto1_big() %>?name=<%=model.getPhoto1_big() %>&kind=img" />
							</td>
							<td>
							<img src="/download/<%=model.getPhoto2_big() %>?name=<%=model.getPhoto2_big() %>&kind=img" />
							</td>
				        </tr>
				        <tr>
							<td>
							<img src="/download/<%=model.getPhoto3_big() %>?name=<%=model.getPhoto3_big() %>&kind=img" />
							</td>
							<td>
							<img src="/download/<%=model.getPhoto4_big() %>?name=<%=model.getPhoto4_big() %>&kind=img" />
							</td>
				        </tr>
				        <tr>
							<td>
							<img src="/download/<%=model.getPhoto5_big() %>?name=<%=model.getPhoto5_big() %>&kind=img" />
							</td> 
							<td>
							<img src="/download/<%=model.getPhoto6_big() %>?name=<%=model.getPhoto6_big() %>&kind=img" />
							</td>
				        </tr>
				    </tbody>
					</table>
				<!-- 버튼 시작 -->
				<div class="btn-all-align2">
				  <span class="btn-align"><input type="submit" value="수정" class="btn-bg-gray"  /></span>
				  <span class="btn-align"><input type="button" value="삭제" id="btDelete" class="btn-bg-gray"  /></span>
				  <span class="btn-align"><input type="button" value="목록" id="btList" class="btn-bg-gray"  /></span>
				</div>
				<!-- 버튼 끝 -->
				<!-- 실제적인 리스트 끝 -->
				</form>
			</div>
			<!--Contents End-->
		</div>
	</div>
</div>
<!--floater-->
<%@ include file="/admin/common/bottom.jsp" %>
<!--floater-->
</body>
</html>